import request from '../utils/request.ts';

export interface ChargeOrder {
    completedTime?: string;
    createdTime?: string;
    orderNo?: string;
    requestAmount?: number;
    status?: number;
    userId?: number;
}

// 添加充值订单
export const addChargeOrderService = (amount: number) => {
    return request.post(`/chargeOrder/add/${amount}`);
}

// 获取所有充值订单列表
export const getChargeOrderListService = () => {
    const response = request.get<ChargeOrder[]>('/chargeOrder/findAll');
    console.log('获取所有充值订单列表response',response);
    return response;
}

// 删除充值订单
export const deleteChargeOrderService = async (orderNo: string) => {
    const orderNoBigInt = BigInt(orderNo);
    return await request.delete(`/chargeOrder/delete/${orderNoBigInt}`);
}


